package com.ruoyi.score.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.entity.SysUser;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 积分明细对象 score_detail
 * 
 * @author ruoyi
 * @date 2024-08-13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ScoreDetail implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** 主键id */
    @TableId
    private Long id;

    /** 消费积分 */
    @Excel(name = "消费积分")
    private Long scoreConsume;

    /** 消费获取时间 */
    @Excel(name = "消费积分")
    @JsonFormat(pattern = "yy-MM-dd HH:mm:ss" , timezone = "GMT+8")
    @DateTimeFormat(pattern = "yy-MM-dd HH:mm:ss")
    private Date updateTime;

    /** 备注 */
    @Excel(name = "备注")
    private String scoreDetailNote;

    /** 用户id */
    @Excel(name = "用户id")
    private Long userId;

    /** 用户名称 */
    @Excel(name = "用户id")
    @TableField(exist = false)
    private String username;

    /** 用户 */
    @TableField(exist = false)
    private SysUser sysUser;

    /** 逻辑删除字段 */
    private Long del;

    public ScoreDetail(Long scoreConsume, Date updateTime, String scoreDetailNote, Long userId) {
        this.scoreConsume = scoreConsume;
        this.updateTime = updateTime;
        this.scoreDetailNote = scoreDetailNote;
        this.userId = userId;
    }
}
